<?php
defined('_JEXEC') or die('Restricted access');

	//default configuration
    $config =& JComponentHelper::getParams( 'com_nv' );
		 

    $gmapkey = $config->get( 'gmapkey' );
    $secondzoom = 3;
 
    
	
	$marker = 'http://www.google.com/mapfiles/marker.png';
	
	
//add javascript
	$js1 = JURI::base().'components/com_nv/assets/js/prototype.js';


	$js4 = JURI::base().'components/com_nv/assets/js/lightwindow.js';
	$js5 = JURI::base().'components/com_nv/assets/js/effects.js';
	
	//add css
	$css1 = JURI::base().'components/com_nv/assets/css/lightbox.css';
	$css2 = JURI::base().'components/com_nv/assets/css/objek.css';
	$css3 = JURI::base().'components/com_nv/assets/css/moodalbox.css';
	$css4 = JURI::base().'components/com_nv/assets/css/common.css';
	
	foreach ($this->dataobjek as $objek){
	$latitude = $objek->latitude;
	$longitude =  $objek->longitude;
	$name =  $objek->name;
	$kota =  $objek->nama_kota;
	$keterangan =  $objek->keterangan;
	}
	
	
?>

<script type="text/javascript" src="<?echo $js1 ?>"></script>
<script type="text/javascript" src="<?echo $js4 ?>"></script>
<script type="text/javascript" src="<?echo $js5 ?>"></script>

<link rel="stylesheet" href="<?echo $css1 ?>" type="text/css" media="screen" />
<link rel="stylesheet" href="<?echo $css2 ?>" type="text/css" media="screen" />
<link rel="stylesheet" href="<?echo $css3 ?>" type="text/css" media="screen" />
<link rel="stylesheet" href="<?echo $css4 ?>" type="text/css" media="screen" />

<script type="text/javascript">
function startGallery() {
var myGallery = new gallery($('myGallery'), {
timed: false
});
}
window.addEvent('domready', startGallery);
</script>

<div class="componentheading"> <?echo $name ?> - <? echo $kota?></div>





<div id="svmap_canvas" ></div>


<div id="blogwidget">
<fieldset>
<legend>Blog</legend>
<? echo $this->datablog;?>
</fieldset>
</div>

<div id="videowidget">
<fieldset class="fieldset">
<legend>Video</legend>
<? foreach($this->datavid as $youtube)
{ ?>


 <a href="http://www.youtube.com/v/<? echo $youtube->linkvideo ?>" class="lightwindow page-options" params="lightwindow_width=425,lightwindow_height=340,lightwindow_loading_animation=false" title="<? echo $youtube->title ?>" >
 <img src="<? echo $youtube->thumbnail ?>" alt="<? echo $youtube->videoid ?>" class="imgVideo"/> </a>
<? }?>

</fieldset>
</div>
 
<div id="picwidget" >
<fieldset>
<legend>Foto <?echo $name ?></legend>
<? foreach($this->datapic as $flickr)
{ ?>
  
	<a href="<? echo $flickr->url ?>" class="lightwindow page-options" title="<? echo $flickr->title ?>">
	<img src="<? echo $flickr->thumbnail ?>" alt="<? echo $flickr->title ?>" />
	</a> 
  
  <? }?>
</fieldset>
</div>

<div id="eventwidget" >
<fieldset>
<legend>Event di <?echo $kota ?></legend>
<? foreach($this->dataevent as $event)
{ ?>

<h1><?echo $event->title; ?></h1>

<p><? echo "Description : ".$event->description; ?></p>

<? }?>
</fieldset>
</div>
<div id="weatherwidget" >
<fieldset >
<legend>Cuaca <?echo $kota ?></legend>
<? foreach($this->dataweather as $weather)
{ ?>

<h1><?echo $weather->title; ?></h1>

<p><? echo "Description : ".$weather->description; ?></p>

<? }?>
</fieldset>
</div>










   
   <script type="text/javascript"
            src="http://www.google.com/jsapi?key=<?echo $gmapkey ?>"></script>

  
  <script type="text/javascript">
  google.load("maps", "2.x");
   
  // Call this function when the page has been loaded
   function initialize() {
    var map = new google.maps.Map2(document.getElementById("svmap_canvas"));
    map.setCenter(new google.maps.LatLng(<?echo $latitude ?>, <?  echo $longitude ?>), <?echo $secondzoom ?>);
    
    var myHtml = "<h4>Selamat Datang Di <? echo $name?></h4><? echo $keterangan?>";
    
    
    var nvicon = new google.maps.Icon();
    nvicon.image = 'http://poss.its.ac.id/risetnv/markers/image.png'; 
    nvicon.shadow = '';
    nvicon.iconSize = new google.maps.Size(24,46);
    nvicon.iconAnchor = new google.maps.Point(12,46);
    nvicon.infoWindowAnchor = new google.maps.Point(12,0);
    var point = new google.maps.LatLng(<? echo $latitude ?>, <? echo $longitude?>);
    var markerOptions = {icon:nvicon, draggable: true};
    var marker = new google.maps.Marker(point,markerOptions);

    marker.openInfoWindowHtml(myHtml);
    map.addOverlay(marker);
    map.setUIToDefault();
	
	
	
    
  }
  
  function mapsLoaded(){
  
  }
  google.setOnLoadCallback(initialize);
  
</script>

  



